package cn.app.utils;

import java.util.List;

public class PageBean<T> {
	private Integer currentPage;
	
	private Integer pageSize;
	
	private Integer totalCount;
	
	private Integer totalPage;//totalCount % pageSize == 0 ? totalCount / pageSize : totalCount / pageSize + 1;
	
	private Integer startIndex;//(currentPage - 1) * pageSize;

	
	private List<T> pageList;
	
	
	
	
	
	public PageBean(Integer currentPage, Integer pageSize, Integer totalCount) {
		this.currentPage = currentPage != null ? currentPage : 1;
		this.pageSize = pageSize != null ? pageSize : 5;
		this.totalCount = totalCount != null ? totalCount : 0;
		this.totalPage = this.totalCount % this.pageSize == 0 ? this.totalCount / this.pageSize : this.totalCount / this.pageSize + 1;
		this.startIndex = (this.currentPage - 1) * this.pageSize;
	}
	
	
	
	

	public List<T> getPageList() {
		return pageList;
	}





	public void setPageList(List<T> pageList) {
		this.pageList = pageList;
	}





	public Integer getCurrentPage() {
		return currentPage;
	}

	public void setCurrentPage(Integer currentPage) {
		this.currentPage = currentPage;
	}

	public Integer getPageSize() {
		return pageSize;
	}

	public void setPageSize(Integer pageSize) {
		this.pageSize = pageSize;
	}

	public Integer getTotalCount() {
		return totalCount;
	}

	public void setTotalCount(Integer totalCount) {
		this.totalCount = totalCount;
	}

	public Integer getTotalPage() {
		return totalPage;
	}

	public void setTotalPage(Integer totalPage) {
		this.totalPage = totalPage;
	}

	public Integer getStartIndex() {
		return startIndex;
	}

	public void setStartIndex(Integer startIndex) {
		this.startIndex = startIndex;
	}
	
	
	
	
}
